package com.tisumoon.msg.data.bean.receive;

import com.google.gson.reflect.TypeToken;
import com.tisumoon.msg.data.abs.AbsReceived;

/**
<pre>
{
	"type": "userread", //说明类型已读标记
	"userread": [
	             {
	            	 "num": "3", //这个用户的已读标记数量
	            	 "time": "1400925276", //最后一条已读消息的发送的服务器响应时间
	            	 "uid": "1000000023" //聊天的对方的用户uid
	             },
	             {
	            	 "num": "1",
	            	 "time": "1400777862",
	            	 "uid": "1000000025"
	             }
	            ]
}
</pre>
 */
public class ArriveStateUnload extends AbsReceived<ArriveStateUnload> {
	public static final String TYPE_RECEIVED_NUM		= "userreceivednum";
	public static final String TYPE_READ_NUM			= "userreadnum";

	public Info[] infos;

	public boolean isUserReceivedNum() {
		return type.equals(TYPE_RECEIVED_NUM);
	}

	public boolean isUserReadNum() {
		return type.equals(TYPE_READ_NUM);
	}

	public static class Info {
		public int num;
		public long time;
		public long uid;
	}

	@Override
	public ArriveStateUnload fromJson(String json) {
		return fromJsonWithAllFields(json, ArriveStateUnload.class);
	}

	@Override
	protected String[] typeValues() {
		return new String[]{TYPE_RECEIVED_NUM, TYPE_READ_NUM};
	}

	@Override
	protected TypeToken<ArriveStateUnload> getTypeToken() {
		return null;
	}
}
